<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="s" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="sf" uri="http://www.springframework.org/tags/form"%>


<div class="maindivForm">

	<sf:form modelAttribute="registerObj">
		<h3>Registration Summary</h3>

<c:forEach begin="0" end="${registerObj.participantSize-1}" var="i">
		<table class="reviewtbl">
			<tr>
				<th colspan="2"><h3>PARTICIPANT ${i+1}: Personal Particulars</h3>
				</th>
			</tr>
			<tr>
				<td width="35%">Salutation</td>
				<td>${registerObj.participantList[i].salutation}</td>	
			</tr>
			<tr>
				<td>Family Name/Last Name</td>
				<td>${registerObj.participantList[i].lastName}</td>
			</tr>
			<tr>
				<td>First Name</td>
				<td>${registerObj.participantList[i].firstName}</td>
			</tr>
			<tr>
				<td>Name to appear on badge</td>
				<td>${registerObj.participantList[i].badgeName}</td>
			</tr>
			<tr>
				<td>Designation</td>
				<td>${registerObj.participantList[i].designation}</td>
			</tr>
			<tr>
				<td>Contact Number</td>
				<td>${registerObj.participantList[i].telephone}</td>
			</tr>
			<tr>
				<td>Email Address</td>
				<td>${registerObj.participantList[i].email}</td>
			</tr>			
			<tr>
				<td colspan="2">&nbsp;</td>
			</tr>
			<tr>
				<td colspan="2">Selected Conference Package(s)</td>
			</tr>		
			<tr>
				<td colspan="2">&nbsp;</td>
			</tr>
			<tr>
				<td colspan="2">
					<ul class="summaryprice">
						<c:choose>
						<c:when test="${registerObj.participantList[i].packageId eq 1}"><li>
							<b>Full Conference</b>
							<ul class="reviewbreakoutlist">
								<c:if test="${registerObj.participantList[i].breakout1 eq 1}">
									<li><b>Breakout Session 1A</b>
									<br/>&nbsp;Diversity &amp; Inclusion: Beyond Business ROI</li>
								</c:if>
								<c:if test="${registerObj.participantList[i].breakout1 eq 2}">
									<li><b>Breakout Session 1B</b>
									<br/>&nbsp;Maximising Your Local Talent</li>
								</c:if>
								<c:if test="${registerObj.participantList[i].breakout2 eq 1}">
									<li><b>Breakout Session 2A</b>
									<br/>&nbsp;Power of Inclusion: Celebrating Age Diversity
									</li>
								</c:if>
								<c:if test="${registerObj.participantList[i].breakout2 eq 2}">
									<li><b>Breakout Session 2B</b>
									<br/>&nbsp;Leadership, When Gender Matters?
									</li>
								</c:if>
							</ul>
						</li></c:when>
						<c:when test="${registerObj.participantList[i].packageId eq 2}"><li><b>Plenary Session Only</b></li></c:when>
						<c:when test="${registerObj.participantList[i].packageId eq 3}"><li>
							<b>Breakout Sessions Only</b>
							<ul class="reviewbreakoutlist">
								<c:if test="${registerObj.participantList[i].breakout1 eq 1}">
									<li><b>Breakout Session 1A</b>
									<br/>&nbsp;Diversity &amp; Inclusion: Beyond Business ROI</li>
								</c:if>
								<c:if test="${registerObj.participantList[i].breakout1 eq 2}">
									<li><b>Breakout Session 1B</b>
									<br/>&nbsp;Maximising Your Local Talent</li>
								</c:if>
								<c:if test="${registerObj.participantList[i].breakout2 eq 1}">
									<li><b>Breakout Session 2A</b>
									<br/>&nbsp;Power of Inclusion: Celebrating Age Diversity
									</li>
								</c:if>
								<c:if test="${registerObj.participantList[i].breakout2 eq 2}">
									<li><b>Breakout Session 2B</b>
									<br/>&nbsp;Leadership, When Gender Matters?
									</li>
								</c:if>
							</ul>
						 </li></c:when>
						</c:choose>
						<c:if test="${registerObj.participantList[i].post1}"><li><b>Post-Conference Workshop 1</b>
							<br/>Making Diversity Work in Your Organization
						</li></c:if>
						<c:if test="${registerObj.participantList[i].post2}"><li><b>Post-Conference Workshop 2</b>
							<br/>Driving Your Diversity &amp; Inclusion Strategy in Singapore - The Power of the DIAN Strategy Framework
						</li></c:if>
					</ul>
				</td>
			</tr>
		</table>
</c:forEach>
		<br/>
		<h3>Price Summary</h3>
		<table border="1" width="90%" class="paymentsummarytbl">
			<tr>
				<th width="5%">No</th>
				<th width="40%">Name</th>
				<th width="45%">Conference Package</th>
				<th>Price</th>
			</tr>
			
			<c:forEach items="${registerObj.participantList}" var="p" varStatus="pStatus">
			<tr>
				<td>${pStatus.index+1}</td>
				<td><c:out value="${p.firstName} ${p.lastName}"/></td>
				<td>
					<ul>
						<c:choose>
						<c:when test="${p.packageId eq 1}"><li>Full Conference - 
							<c:choose>
								<c:when test="${p.subamount[0] le 0}">Free</c:when>
								<c:otherwise><fmt:formatNumber value="${p.subamount[0]}" currencySymbol="S$" type="currency"/></c:otherwise>
							</c:choose>
						</li></c:when>
						<c:when test="${p.packageId eq 2}"><li>Plenary Session Only -
							<c:choose>
								<c:when test="${p.subamount[1] le 0}">Free</c:when>
								<c:otherwise><fmt:formatNumber value="${p.subamount[1]}" currencySymbol="S$" type="currency"/></c:otherwise>
							</c:choose>
						</li></c:when>
						<c:when test="${p.packageId eq 3}"><li>Breakout Sessions Only - 
							<c:choose>
								<c:when test="${p.subamount[2] le 0}">Free</c:when>
								<c:otherwise><fmt:formatNumber value="${p.subamount[2]}" currencySymbol="S$" type="currency"/></c:otherwise>
							</c:choose>
						</li></c:when>
						</c:choose>
						<c:if test="${p.post1}"><li>Post-Conference Workshop 1 - 
							<c:choose>
								<c:when test="${p.subamount[3] le 0}">Free</c:when>
								<c:otherwise><fmt:formatNumber value="${p.subamount[3]}" currencySymbol="S$" type="currency"/></c:otherwise>
							</c:choose>
						</li></c:if>
						<c:if test="${p.post2}"><li>Post-Conference Workshop 2 -
							<c:choose>
								<c:when test="${p.subamount[4] le 0}">Free</c:when>
								<c:otherwise><fmt:formatNumber value="${p.subamount[4]}" currencySymbol="S$" type="currency"/></c:otherwise>
							</c:choose> 
						</li></c:if>
					</ul>
				</td>
				<td><fmt:formatNumber value="${p.amount}" currencySymbol="S$" type="currency"/></td>
			</tr>
			</c:forEach>
			<tr>
				<td></td>
				<td colspan="2" style="text-align: right;"><b>Total</b></td>
				<td><fmt:formatNumber value="${registerObj.amount}" currencySymbol="S$" type="currency"/></td>
			</tr>
		</table>
			

		<br/>
		<br/>
	<input type="submit" name="_eventId_back" value="Edit">
	<input type="submit" name="_eventId_next" value="${registerObj.amount gt 0?'Proceed to Payment':'Confirm Registration'}">
		<input type="hidden" name="_flowExecutionKey" value="${flowExecutionKey}" />
	<br/><br/>
	
	</sf:form>

</div>

